package com.augn.controller;

import com.augn.entity.GoodsEvaluateMain;
import com.augn.entity.Result;
import com.augn.service.IGoodsEvaluateMainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Iterator;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author augn
 * @since 2022-09-22
 */
@RestController
@RequestMapping("/goodsEvaluateMain")
public class GoodsEvaluateMainController {

    @Autowired
    private IGoodsEvaluateMainService service;

    @PostMapping("/insertOne")
    public Result<?> insertOneGoodsEvaluateMain(@RequestBody GoodsEvaluateMain goodsEvaluateMain){
        return service.insertOneGoodsEvaluateMain(goodsEvaluateMain);
    }
    @DeleteMapping("/deleteOne/{id}")
    public Result<?> deleteOneGoodsEvaluateMain(@PathVariable Integer id){
        return service.deleteOneGoodsEvaluateMain(id);
    }

    @GetMapping("/getOne/{id}")
    public Result<?> getOneGoodsEvaluate(@PathVariable Integer id){
        return service.getOneGoodsEvaluate(id);
    }

    @GetMapping("/getPart/{id}")
    public Result<?> getPartGoodsEvaluate(@PathVariable Integer id,
                                      @RequestParam(required = false) Integer pageNum,
                                      @RequestParam(required = false) Integer pageSize) {
        return service.getPartGoodsEvaluate(id,pageNum,pageSize);
    }

}
